package com.bgIntlgn.client.entity.manufacture.picLibrary;

import yuhuibear.poat.annotations.relation.View;
import yuhuibear.poat.object.bean.Bean;

/**
 * 部长有(部长及其下属有的,但不一定在部长处)
 * 
 * @author Simon Chen
 * 
 */
@View(name = "department_has", sqlToCreate = "select departmenthas.pic_paper_id as pic_paper_id, departmenthas.quantity as totalquantity, (departmenthas.quantity-employeehas.quantity) as factquantity "
		+ "from( (select ppcl.pic_paper_id as pic_paper_id, sum(ppcl.quantity) as quantity from pic_papaer_circulate_librarys as ppcl where ppcl.place = 1 group by ppcl.pic_paper_id having sum(ppcl.quantity)>0) as departmenthas left outer join "
		+ "(select ppcl.pic_paper_id as pic_paper_id, sum(ppcl.quantity) as quantity from pic_papaer_circulate_librarys as ppcl where ppcl.place = 2 group by ppcl.pic_paper_id ) as employeehas "
		+ " on employeehas.pic_paper_id = departmenthas.pic_paper_id )")
public class DepartmentHas implements Bean {

	private String picPaperId;
	// 图纸总数
	private Long totalquantity;
	// 实际有的（部分借给了员工）
	private Long factquantity;

	public String getPicPaperId() {
		return picPaperId;
	}

	public void setPicPaperId(String picPaperId) {
		this.picPaperId = picPaperId;
	}

	public Long getTotalquantity() {
		return totalquantity;
	}

	public void setTotalquantity(Long totalquantity) {
		this.totalquantity = totalquantity;
	}

	public Long getFactquantity() {
		return factquantity;
	}

	public void setFactquantity(Long factquantity) {
		this.factquantity = factquantity;
	}
}
